import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
// tslint:disable-next-line:ordered-imports
import remove from '@dfeidao/atom-web/dom/remove';
import p002 from './p002';

export default async function a001(fd: IFeidaoAiBrowserComponent) {
	// 获取部门名称下拉框中的数据
	const equip_depart = fd.data.node.querySelector<HTMLSelectElement>('[data-id="equip_depart"]').value;
	// 获取该部门下的部门名称
	const dt = await nodejs('project-assets/zj-000001/s002', {
		equip_depart
	});
	// 将获取到的数据渲染到部门名称下拉框
	const project = fd.data.node.querySelector<HTMLSelectElement>('[data-id="project"]');
	remove(project);
	render(fd, dt, p002, 'p002', 'lastin');
}
